package net.sf.jOpinionPoll.dao;

import java.util.HashMap;
import java.util.Map;
import java.util.Set;

public class ParameterMap {
	private HashMap<String, Object> m_ParameterMap;
	public static final String WILD_CARD = "*";
	
	public ParameterMap() {
		this(3);
	}
	
	public ParameterMap(int size) {
		m_ParameterMap = new HashMap<String, Object>(size);
	}
	
	public void put(String param, Object value) {
		m_ParameterMap.put(param, value);
	}
	
	/*
	public void put(String param, String value, String header, String trailler) {
		if (value != null) {
			StringBuilder sb = new StringBuilder();
			if (header != null)
				sb.insert(0, header);
			
			sb.append(value);
			
			if (trailler != null)
				sb.append(trailler);
			
			put(param, sb.toString());
		}
		else
			put(param, null);
		
	}
	*/

	public Object get(String param) {
		return m_ParameterMap.get(param);
	}
	
	public Set<Map.Entry<String, Object>> entryEntry() {
		return m_ParameterMap.entrySet();
	}
	
	public boolean isEmptyValue(String name) {
		return get(name) == null || get(name).toString().trim().length() == 0;  
	}
	
	public void remove(int index) {
		m_ParameterMap.remove(index);
	}
	
	public int size() {
		return m_ParameterMap.size();
	}
	
	public void clear() {
		m_ParameterMap.clear();
	}
}
